package com.kongjs.common.core.context;

public class InheritableThreadLocalContextHolderStrategy implements ContextHolderStrategy {
    private static final ThreadLocal<Context> contextHolder = new InheritableThreadLocal<>();

    @Override
    public void clearContext() {
        contextHolder.remove();
    }

    @Override
    public Context getContext() {
        return contextHolder.get();
    }

    @Override
    public void setContext(Context context) {
        contextHolder.set(context);
    }
}
